package com.vf.admin.client.service.impl;

import com.vf.admin.client.dao.AppSpouseClerkDao;
import com.vf.admin.client.service.AppSpouseClerkService;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppSpouseClerk;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppSpouseClerkServiceImpl implements AppSpouseClerkService {

    @Autowired
    private AppSpouseClerkDao appSpouseClerkDao;

    @Override
    public AppSpouseClerk randomGet(Integer sex) {
        AppSpouseClerk appSpouseClerk = appSpouseClerkDao.randomGet(sex);
        if(appSpouseClerk!=null){
            return appSpouseClerk;
        }
        return null;
    }

    @Override
    public List<AppSpouseClerk> getList(SplitPageBean splitPageBean, AppSpouseClerk appSpouseClerk) {
        List<AppSpouseClerk> list = appSpouseClerkDao.getList(splitPageBean, appSpouseClerk);
        if(list!=null && list.size()>0){
            return list;
        }
        return null;
    }

    @Override
    public AppSpouseClerk getClerkById(Integer id) {
        return appSpouseClerkDao.get(id,AppSpouseClerk.class);
    }

    @Override
    public void addOrEdit(AppSpouseClerk appSpouseClerk) {
        appSpouseClerkDao.addOrEdit(appSpouseClerk);
    }
}
